package spring.my.db.sharding.demo.config.db;

public class DynamicDataSourceHolder {

    public static final ThreadLocal<String> holder = new ThreadLocal<String>();

    public static final String MASTER = "masterDataSource";

    public static boolean isMaster = true;


    public static void putDataSource(String name) {
        holder.set(name);
    }

    public static String getDataSource() {
        return holder.get();
    }

    public enum DataSourceType {
        MASTER,
        SLAVE;
    }
}
